#pragma once 
#include"Common.h"
#include"CentralCache.h"
#include"ObjectPool.h"
class ThreadCache{
    public:
    ThreadCache();
        void* Allocate(size_t size);
        void Deallocate(void* ptr,size_t size);
        void* FetchFromCentralCache(size_t index,size_t size);//从中心缓存获取内存块
        void ListTooLong(FreeList& list,size_t size);//链表过大时，回收到中心缓存
    private:
        std::vector<FreeList> _freeLists;
};
//每个线程独有一个ThreadCache
//__thread 线程局部存储
extern thread_local ThreadCache* pTLSThreadCache;   // 声明线程局部变量
